package cn.hpe.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Admininfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "admininfo")
public class Admininfo implements java.io.Serializable {

	// Fields

	private Integer amId;
	private Role role;
	private String amName;
	private String amPwd;

	// Constructors

	/** default constructor */
	public Admininfo() {
	}

	/** full constructor */
	public Admininfo(Role role, String amName, String amPwd) {
		this.role = role;
		this.amName = amName;
		this.amPwd = amPwd;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "AmId", unique = true, nullable = false)
	public Integer getAmId() {
		return this.amId;
	}

	public void setAmId(Integer amId) {
		this.amId = amId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RoleId")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "AmName", length = 50)
	public String getAmName() {
		return this.amName;
	}

	public void setAmName(String amName) {
		this.amName = amName;
	}

	@Column(name = "AmPwd", length = 16)
	public String getAmPwd() {
		return this.amPwd;
	}

	public void setAmPwd(String amPwd) {
		this.amPwd = amPwd;
	}

}